package Demo1;
//创建一个Cat类：extends表示继承
public class Cat extends Animal {

    //行为：成员方法
    @Override//eat方法重写
    public void eat(){

        System.out.println(name + "在吃饭......");
    }
    @Override//sleep方法重写
    public void sleep(){
        System.out.println(name + "在睡觉......");
    }
    public void mem(){

        System.out.println(name + "在喵喵喵......");
    }

    public static void main(String[] args) {
        //类名 + 变量名  new 类名（）；
        Cat cat = new Cat();

        //初始化
        cat.name = "花花";
        cat.age = 20;
        cat.color = "orange";

        //输出
        System.out.println("Cat:" + cat.name + " " +
                cat.age + " " + cat.color );
    }
}

